package com.util;

import java.util.List;
import java.util.UUID;

public class StringHelper
{
	
	public static String appendSpace(String  para){
		if(null == para){return "";}
        int length = para.length();   
        char[] value = new char[length << 1];   
        for (int i=0, j=0; i<length; ++i, j = i << 1) {   
            value[j] = para.charAt(i);   
            value[1 + j] = ' ';   
        }   
        return new String(value);   
    } 
	
	public static void isNull( Object object,List list,String mess )
	{
		if(object == null || "".equals(object)){
			list.add(mess);
		}
	}
	
	public static String getUUID(){
		return UUID.randomUUID().toString();
	}
	
	public static String getStringObjectValue( Object object )
	{
		if( object == null )
		{
			return "";
		}else
		{
			return ((String)object).trim();
		}
	}
	
	public static int getIntegerObjectValue( Object object )
	{
		if( object == null )
		{
			return -1;
		}else
		{
//			return ((Integer)object).intValue();
			return Integer.parseInt(object+"");
		}
	}

	
}
